package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogController {

    //1.得到日志对象
    private static Logger log =
            LoggerFactory.getLogger(LogController.class);
    @RequestMapping("/log")
    public void log(){
        String msg = "小张学编程";
        log.trace("trace ->" +msg);
        log.debug("debug ->"+msg);
        log.info("info ->" +msg);
        log.warn("warn ->"+msg);
        log.error("error ->"+msg);
    }

}
